package com.qian.service.ddj.entity;

import com.yaowk.service.common.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import java.math.BigDecimal;
import java.util.Date;

@Getter
@Setter
@ToString
@Entity
@DynamicInsert
@DynamicUpdate
public class DdjCash extends BaseEntity<Integer> {

    @Column(nullable = false, insertable = false, updatable = false)
    private Integer userId;
    private BigDecimal money; // 实际金额
    private BigDecimal fee; // 手续费
    @Column(nullable = false)
    private BigDecimal total; // 提现金额
    @ColumnDefault("1")
    @Column(nullable = false)
    private Byte status;
    @Column(nullable = false, updatable = false)
    @CreationTimestamp
    private Date createTime;
    private Date finishTime;
    private String cardPerson; // 持卡人
    private String CardNo; // 卡号
    private String cardPhone; // 手机号
    private String cardBank; // 银行
    private String remark; // 备注
    @Column(nullable = false)
    private Byte type; // 提现类型
    private Integer businessCardId;

    @ManyToOne
    @JoinColumn(name = "userId")
    private DdjUser user;
}
